using System;
using System.Collections.Generic;
using System.Text;

namespace Sio.Mdm.Server
{
    public interface IServer
    {
        /// <summary>
        /// Get service instance based on implemented interface type
        /// </summary>
        /// <param name="interfaceType">Interface type that service implements</param>
        IService GetService(Type interfaceType);
        /// <summary>
        /// Get service of specified type
        /// </summary>
        /// <typeparam name="T">Type of service to get</typeparam>
        /// <returns></returns>
        IService GetService<T>() where T: class, IService;
        /// <summary>
        /// Get service instance based on service name
        /// </summary>
        /// <param name="serviceName">Name of the service</param>
        IService GetService(string serviceName);

        /// <summary>
        /// Test wheater specified service is available
        /// </summary>
        /// <param name="interfaceType">Type of service interface to test for</param>
        /// <returns>True if service is implemented</returns>
        bool HasService(Type interfaceType);
        /// <summary>
        /// Test wheater specified service is available
        /// </summary>
        /// <param name="serviceName">Name of the service to test for</param>
        /// <returns>True if service is implemented</returns>
        bool HasService(string serviceName);

        /// <summary>
        /// Get information for service
        /// </summary>
        /// <param name="serviceName">Name of service to get information for</param>
        /// <returns><see cref="ServiceInfo"/> or null if no service by passed name exist</returns>
        ServiceInfo GetServiceInfo(string serviceName);
    }
}
